package ReefStats::Schema::ReefStatsDB::ActionsReasons;

use strict;
use warnings;

use base 'DBIx::Class';
use ReefStats::Schema::DataTypes;

=pod

+---------+-----------------------+------+-----+------------+-------+
| Field   | Type                  | Null | Key | Default    | Extra |
+---------+-----------------------+------+-----+------------+-------+
| day     | date                  | NO   | PRI | 0000-00-00 |       | 
| cluster | varchar(100)          | NO   | PRI | NULL       |       | 
| domain  | varchar(100)          | NO   | PRI | NULL       |       | 
| user    | varchar(100)          | NO   | PRI | NULL       |       | 
| action  | varchar(100)          | NO   | PRI | NULL       |       | 
| reason  | varchar(100)          | NO   | PRI | NULL       |       | 
| number  | mediumint(8) unsigned | YES  |     | NULL       |       | 
+---------+-----------------------+------+-----+------------+-------+

=cut

__PACKAGE__->load_components("Core");
__PACKAGE__->table("actions_reasons");
__PACKAGE__->add_columns(
    day     => { @_datetime,    @_not_null, @_default_nodate, },
    cluster => { @_varchar_100, @_not_null, },
    domain  => { @_varchar_100, @_not_null, },
    user    => { @_varchar_100, @_not_null, },
    action  => { @_varchar_100, @_not_null, },
    reason  => { @_varchar_100, @_not_null, },
    number => { @_mediumint, @_not_null, extra => { @_unsigned, }, },
);

__PACKAGE__->set_primary_key(qw(day cluster domain user action reason));

1;
